package com.example.My.controller;

import com.example.My.pojo.Mail;
import com.example.My.service.MailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * Author: 谢宇
 * CreatTime 2023/11/18 11:58
 * Version 1.0.0
 */
@RestController
@RequestMapping("/sendMail")
public class sendMailController {
    @Autowired
    private MailService sendMailService;

    @PostMapping("/simple")
    public void SendSimpleMessage(@RequestBody Mail mailRequest) {
        sendMailService.sendSimpleMail(mailRequest);
    }

    /**
     * todo 发送html邮箱
     * @param mailRequest
     */
    @PostMapping("/html")
    public void SendHtmlMessage(@RequestBody Mail mailRequest) {
        sendMailService.sendHtmlMail(mailRequest);
    }

}
